<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@page import="weaver.conn.RecordSet" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>访问数据库ip监控---无认证-泛微OA</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <%
        RecordSet rs = new RecordSet();
        //定义给出的sql斌不能执行
    	String strSql = "select sys_context('userenv','host') hostname,UTL_INADDR.get_host_address(sys_context('userenv','host')) ip from dual";
		//select sys_context('userenv','host') hostname,sys_context('userenv','ip_address') ip from dual
		strSql="select sys_context('userenv','host') hostname,sys_context('userenv','ip_address') ip from dual";
		rs.executeSql(strSql);
		String ip = "";
		String hostname = "";
		if(rs.next()){
			 hostname = rs.getString("hostname");
			 ip = rs.getString("ip");
			}
		out.println("{'hostname':"+hostname+",'ip':"+ip+"}");
     %>
  </body>
</html>
